package ynu.edu.util;


import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DocConfig {
    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .addOpenApiCustomizer(openApi -> openApi.setInfo(apiInfo())).group("public")
                .packagesToScan("ynu.edu.controller").build();
    }
    private Info apiInfo() {
        return new Info().title("接口说明").description("第一个接口文档").contact(new Contact().name("小明").email("hezl@ynu.edu.cn").url("www.ynu.edu.cn")).version("v1.0");
    }
}
